package ch.epfl.lara.matcheck.util.printer;

trait Formatter {

  protected val SPACE: String = " "
    
  protected var indent = 0
  protected val shift = 3
      
  protected def inc: String =  {
    indent += shift
    ""
  }
      
  protected def dec: String =  {
    indent -= shift
    if(indent < 0) throw new Exception("Wrong indentation")
    ""
  }
      
  protected def mkIndent: String = mkSpaces(indent)
  
  protected def mkSpaces(n: Int): String = {
    var buf = ""
    for(val i<- List.range(0,n))
      buf += SPACE
    buf
  }
      
  protected def NL: String  = "\n"+mkIndent
  	    
  protected def NL2: String = NL + NL
}
